<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
	<link rel="stylesheet" href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/font-awesome.min.css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/login.css">
</head>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/font-awesome.min.css">


<title>Insert title here</title>
</head>
<body>
<!-- 面板 -->
<div class="panel panel-default">
  <!-- 面板头-->
  <div class="panel-heading">
  	<i class="glyphicon glyphicon-th"></i>预售申请
  </div>
    <!-- 面板体-->
  <div class="panel-body">
  <form method="post" id="preform" action="${pageContext.request.contextPath}/houses/presell">
  <div class="form-group">
    <label for="exampleInputEmail1">楼盘编号</label>
    <input type="text" class="form-control" id="housesid" name="houses_id" placeholder="楼盘编号">
  </div>
    
    <div class="form-group">
    <label for="exampleInputPassword1">楼盘名称</label>
    <input type="text" class="form-control" id="housesname" n placeholder="楼盘名称" name="presellApply_housesName">
  </div>
  <div class="form-group">
    <label for="exampleInputPassword1">楼盘地址</label>
    <input type="text" class="form-control" id="housesaddress" placeholder="楼盘地址" name="presellApply_housesAddress">
  </div>
    <div class="form-group">
    <label for="exampleInputPassword1">法人姓名</label>
    <input type="text" class="form-control" id="presellername" placeholder="法人姓名" name="presellApply_proposerName">
</div>
    <div class="form-group">
    <label for="exampleInputPassword1">法人身份证号</label>
    <input type="text" class="form-control" id="presellerid" placeholder="法人身份证号" name="presellApply_proposerIDCard">
    <font  color="red"><span id="prid" ></span></font>
</div>
  <div class="form-group">
    <label for="exampleInputPassword1">开发商</label>
    <input type="text" class="form-control" id="housesdevelopers" placeholder="开发商" name="presellApply_housesDeveloper">
</div>
    <div class="form-group">
    <label for="exampleInputPassword1">公司电话</label>
    <input type="tel" class="form-control" id="comtele" placeholder="公司电话" name="presellApply_proposerPhone">
    <font  color="red"><span id="spantele" ></span></font>
</div>
  <button type="button" id="submit" class="btn btn-default">提交申请</button>
</form>
</div>
</div>

<script type="text/javascript"  src="${pageContext.request.contextPath}/js/jquery-1.12.3.min.js"></script>
<script type="text/javascript"  src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
<script type="text/javascript">
	$(function(){
		$("#presellerid").mouseout(function(){
			var id=$("#presellerid").val()
			$.post("${pageContext.request.contextPath}/houses/checkid",
					{id:id},
					function(data){
						if(data=="\"false\""){
							$("#prid").text("输入身份证号有误，请重新输入")
						}
					})
		})
		$("#comtele").mouseout(function(){
			var tele=$("#comtele").val()
			$.post("${pageContext.request.contextPath}/houses/checktele",
					{tele:tele},
					function(data){
						if(data=="\"false\""){
							$("#spantele").text("输入电话号码有误，请重新输入")
						}
					})
		})
		$("#submit").click(function(){
			var presell = $("#preform").serialize()
			$.post("${pageContext.request.contextPath}/houses/presubmit",
					{presell:presell},
					function(data){
						
					})
		})
	})
</script>
</body>
</html>